
var aArray = new Array( 5 );


for( var i = 0; i < aArray.length; i = i + 1 )
{
	aArray[ i ] = 0;
}



function showImage( nIndex )
{
	aArray[ nIndex ] = aArray[ nIndex ] + 1;
}




function showflagegypt()
{
	aArray[ 0 ] = aArray[ 0 ] + 1;
	document.getElementById( "picture" ).src ="images/egypt.jpg";
	document.getElementById( "picture" ).alt ="This is a picture the flag of Egypt.";	
	document.getElementById( "picture" ).title ="This is a picture of the flag of Egypt.";				
document.getElementById( "caption" ).innerHTML = "This is the flag of Egypt and one of its many pyraminds.";
}

function showflagzimbabwe()
{
	aArray[ 1 ] = aArray[ 1 ] + 1;
	document.getElementById( "picture" ).src = "images/zimbabwe.jpg";
	document.getElementById( "picture" ).alt = "This is the flag of Zimbabwe.";	
	document.getElementById( "picture" ).title = "This is the flag of Zimbabwe.";				

	document.getElementById( "caption" ).innerHTML = "This is the flag of Zimbabwe and a waterfall that is located there.";
}

function showflagsouthafrica()
{
	aArray[ 2 ] = aArray[ 2 ] + 1;
	document.getElementById( "picture" ).src = "images/southafrica.jpg";
	document.getElementById( "picture" ).alt = "This is the flag of South Africa.";	
	document.getElementById( "picture" ).title = "This is the flag of South Africa.";				

	document.getElementById( "caption" ).innerHTML = "This is the flag of South Africa and a picture of the World Cup Championship Rugby Team.";
}

function showflagghana()
{
	aArray[ 3 ] = aArray[ 3 ] + 1;

	document.getElementById( "picture" ).src = "images/ghana.jpg";
	document.getElementById( "picture" ).alt = "This is the flag of Ghana.";	
	document.getElementById( "picture" ).title = "This is the flag of Ghana.";				

	document.getElementById( "caption" ).innerHTML = "This is the flag of Ghana and a picture of a famous comedian from Ghana with the crowd around him";
}

function showflagmorocco()
{
	aArray[ 4 ] = aArray[ 4 ] + 1;
	document.getElementById( "picture" ).src = "images/morocco.jpg";
	document.getElementById( "picture" ).alt = "This is the flag of Morocco.";	
	document.getElementById( "picture" ).title = "This is the flag of Morocco.";				

	document.getElementById( "caption" ).innerHTML = "This is the flag of Morocco and the view of one of its beaches.";
	
}

function showCounter()
{
		
	if( aArray[ 0 ] > 0 && aArray[ 1 ] > 0 && aArray[ 2 ] > 0 
			&& aArray[ 3 ] > 0 && aArray[ 4 ] > 0 )
	{
		alert( "CONGRATULATIONS! " + aArray);
		window.location = "Congrats.html"	;
	}
	else
	{
		alert( "CHEATER--DO IT RIGHT" );
	}
}

